﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Utils
{
    public static class RandomNumberGenerator
    {
        private static readonly Random random = new();

        public static string Generate(int length)
        {
            if (length <= 0)
            {
                throw new ArgumentException("Length must be positive.", nameof(length));
            }

            var builder = new StringBuilder();
            for (int i = 0; i < length; i++)
            {
                builder.Append(random.Next(10));
            }

            return builder.ToString();
        }
    }

}
